AppleBase = function( type )
{
	Bitmap.call(this,ResManager.getInstance().getBmdByName("apple"+type));
	
	this.type = type ;
	this.score = 0 ;
	this.speed = (Math.random()*5+10)>>0 ;
	this.setX( (Math.random()*580 +20) ) >>0;
	this.setY(-this.getHeight());
	
	switch(this.type)
	{
		case 1:
			this.score = 1;
			break ;
		case 2:
			this.score = 2;
			break ;
		case 3:
			this.score = 3;
			break ;
		case 4:
			this.score = -1;
			break ;
	}
};
FLASH.extend( AppleBase  , Bitmap );


AppleBase.randomCreateApple = function()
{
	var type = Math.round(Math.random()*3)+1;
	var apple = new AppleBase(type);
	return apple ;
};